#include <iostream>
using namespace std;

int gcd(int a, int b)
{
	int little = a;
	int large = b;
	if(a > b)
	{
		little = b;
		large = a;
	}
	int temp;
	while(1)
	{
		temp = large % little;
		if(temp == 0)
			return little;
		large = little;
		little = temp;
	}
}


int main()
{	
	cout<<gcd(24, 36)<<endl;
	return 0;
}
